<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OSI 七层模型 - 网络通信的艺术</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .layer-card {
            transition: all 0.3s ease;
            backdrop-filter: blur(10px);
            background: rgba(255, 255, 255, 0.95);
        }
        
        .layer-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .layer-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .protocol-tag {
            transition: all 0.2s ease;
        }
        
        .protocol-tag:hover {
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .first-letter {
            float: left;
            font-size: 4rem;
            line-height: 3.5rem;
            padding-right: 0.5rem;
            font-weight: 700;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center">
            <h1 class="text-5xl md:text-7xl font-bold mb-6 animate-fadeInUp">
                OSI 七层模型
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90 animate-fadeInUp" style="animation-delay: 0.2s;">
                <i class="fas fa-network-wired mr-2"></i>
                网络通信的艺术与科学
            </p>
            <div class="max-w-3xl mx-auto text-lg leading-relaxed animate-fadeInUp" style="animation-delay: 0.4s;">
                <p>
                    <span class="first-letter">O</span>SI 七层模型是理解现代网络通信的基石。从物理信号到应用服务，每一层都扮演着独特而关键的角色，共同构建了我们今天所依赖的互联网世界。
                </p>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-7xl mx-auto px-6 py-12">
        <!-- Introduction -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 animate-fadeInUp">
            <h2 class="text-3xl font-bold mb-6 text-gray-800">
                <i class="fas fa-info-circle text-purple-600 mr-3"></i>
                什么是 OSI 模型？
            </h2>
            <p class="text-lg text-gray-700 leading-relaxed indent-8">
                OSI 七层模型（Open Systems Interconnection Model）是由国际标准化组织（ISO）制定的网络通信模型，用于描述计算机网络中数据的传输和通信过程。它将网络通信过程划分为七个层次，每一层都承担特定的功能，并通过接口与相邻层进行交互。
            </p>
        </section>

        <!-- Interactive Diagram -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12">
            <h2 class="text-3xl font-bold mb-8 text-center text-gray-800">
                <i class="fas fa-sitemap text-purple-600 mr-3"></i>
                OSI 模型架构图
            </h2>
            <div class="mermaid">
                graph TB
                    A[应用层<br/>Application Layer] --> B[表示层<br/>Presentation Layer]
                    B --> C[会话层<br/>Session Layer]
                    C --> D[传输层<br/>Transport Layer]
                    D --> E[网络层<br/>Network Layer]
                    E --> F[数据链路层<br/>Data Link Layer]
                    F --> G[物理层<br/>Physical Layer]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                    style B fill:#764ba2,stroke:#fff,stroke-width:3px,color:#fff
                    style C fill:#8b5cf6,stroke:#fff,stroke-width:3px,color:#fff
                    style D fill:#a855f7,stroke:#fff,stroke-width:3px,color:#fff
                    style E fill:#c084fc,stroke:#fff,stroke-width:3px,color:#fff
                    style F fill:#d8b4fe,stroke:#fff,stroke-width:3px,color:#fff
                    style G fill:#e9d5ff,stroke:#fff,stroke-width:3px,color:#333
            </div>
        </section>

        <!-- Layers Detail -->
        <section class="grid gap-8 mb-12">
            <!-- Layer 1: Physical -->
            <div class="layer-card rounded-2xl shadow-lg p-8">
                <div class="flex items-start mb-6">
                    <span class="layer-number text-6xl font-bold mr-6">1</span>
                    <div class="flex-1">
                        <h3 class="text-2xl font-bold text-gray-800 mb-2">
                            <i class="fas fa-ethernet text-purple-600 mr-2"></i>
                            物理层（Physical Layer）
                        </h3>
                        <p class="text-gray-600">比特流的传输通道</p>
                    </div>
                </div>
                <p class="text-gray-700 leading-relaxed mb-6 indent-8">
                    负责在物理介质上进行数据的实际传输。它定义了电气信号、光信号、无线信号等的传输特性以及物理连接的机械和电气规范。处理数据的比特流（即0和1），定义如何将比特流在物理介质上传输。
                </p>
                <div>
                    <h4 class="font-semibold text-gray-800 mb-3">
                        <i class="fas fa-code text-purple-500 mr-2"></i>
                        主要标准和协议
                    </h4>
                    <div class="flex flex-wrap gap-3">
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-network-wired mr-1"></i> Ethernet
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-usb mr-1"></i> USB
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-phone-alt mr-1"></i> DSL
                        </span>
                    </div>
                </div>
            </div>

            <!-- Layer 2: Data Link -->
            <div class="layer-card rounded-2xl shadow-lg p-8">
                <div class="flex items-start mb-6">
                    <span class="layer-number text-6xl font-bold mr-6">2</span>
                    <div class="flex-1">
                        <h3 class="text-2xl font-bold text-gray-800 mb-2">
                            <i class="fas fa-link text-purple-600 mr-2"></i>
                            数据链路层（Data Link Layer）
                        </h3>
                        <p class="text-gray-600">帧的可靠传输</p>
                    </div>
                </div>
                <p class="text-gray-700 leading-relaxed mb-6 indent-8">
                    负责在相邻节点之间的链路上建立、维护和断开逻辑链接。它将物理层的比特流转化为数据帧，并提供错误检测和纠正。处理数据的帧结构、流量控制和差错控制。
                </p>
                <div>
                    <h4 class="font-semibold text-gray-800 mb-3">
                        <i class="fas fa-code text-purple-500 mr-2"></i>
                        主要标准和协议
                    </h4>
                    <div class="flex flex-wrap gap-3">
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-ethernet mr-1"></i> Ethernet
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-wifi mr-1"></i> Wi-Fi (IEEE 802.11)
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-arrows-alt-h mr-1"></i> PPP
                        </span>
                    </div>
                </div>
            </div>

            <!-- Layer 3: Network -->
            <div class="layer-card rounded-2xl shadow-lg p-8">
                <div class="flex items-start mb-6">
                    <span class="layer-number text-6xl font-bold mr-6">3</span>
                    <div class="flex-1">
                        <h3 class="text-2xl font-bold text-gray-800 mb-2">
                            <i class="fas fa-route text-purple-600 mr-2"></i>
                            网络层（Network Layer）
                        </h3>
                        <p class="text-gray-600">数据包的路由选择</p>
                    </div>
                </div>
                <p class="text-gray-700 leading-relaxed mb-6 indent-8">
                    负责将数据包从源设备路由到目标设备，处理逻辑地址（如 IP 地址），并进行路由选择和数据包转发。提供不同网络之间的互联，管理网络中的数据包传输。
                </p>
                <div>
                    <h4 class="font-semibold text-gray-800 mb-3">
                        <i class="fas fa-code text-purple-500 mr-2"></i>
                        主要标准和协议
                    </h4>
                    <div class="flex flex-wrap gap-3">
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-globe mr-1"></i> IP
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-exclamation-triangle mr-1"></i> ICMP
                        </span>
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-address-card mr-1"></i> ARP
                        </span>
                    </div>
                </div>
            </div>

            <!-- Layer 4: Transport -->
            <div class="layer-card rounded-2xl shadow-lg p-8">
                <div class="flex items-start mb-6">
                    <span class="layer-number text-6xl font-bold mr-6">4</span>
                    <div class="flex-1">
                        <h3 class="text-2xl font-bold text-gray-800 mb-2">
                            <i class="fas fa-exchange-alt text-purple-600 mr-2"></i>
                            传输层（Transport Layer）
                        </h3>
                        <p class="text-gray-600">端到端的可靠传输</p>
                    </div>
                </div>
                <p class="text-gray-700 leading-relaxed mb-6 indent-8">
                    负责数据的端到端传输，提供端口之间的通信，确保数据的完整性和顺序。处理数据的流量控制、错误检测和纠正。
                </p>
                <div>
                    <h4 class="font-semibold text-gray-800 mb-3">
                        <i class="fas fa-code text-purple-500 mr-2"></i>
                        主要标准和协议
                    </h4>
                    <div class="flex flex-wrap gap-3">
                        <span class="protocol-tag bg-purple-100 text-purple-700 px-4 py-2 rounded-full font-medium">
                            <i class="fas fa-handshake mr-1"></i> TCP
                        </span>
                        <span class="protocol-tag bg-purple-100